import {addData, deleteById, pageData, updateById} from "@/services/base-request";
import {ParamsType} from "@ant-design/pro-components";
import {API, DynamicObject} from "@/services/typings";

export const pageDictType = (param: ParamsType, options?: DynamicObject) => {
  return pageData('/dictType', param, options)
}

export const pageDictData = (param: ParamsType, options?: DynamicObject) => {
  return pageData('/dictData', param, options)
}

export const updateDictType = (dictType: API.IDictType, options?: DynamicObject) => {
  return updateById<API.IDictType>('/dictType', dictType, options)
}

export const updateDictData = (dictData: API.IDictData, options?: DynamicObject) => {
  return updateById<API.IDictData>('/dictData', dictData, options)
}

export const addDictType = (dictType: API.IDictType, options?: DynamicObject) => {
  return addData<API.IDictType>('/dictType', dictType, options)
}

export const addDictData = (dictData: API.IDictData, options?: DynamicObject) => {
  return addData<API.IDictData>('/dictData', dictData, options)
}

export const deleteDictType = (id: string | number, options?: DynamicObject) => {
  return deleteById(`/dictType`, id, options)
}

export const deleteDictData = (id: string | number, options?: DynamicObject) => {
  return deleteById(`/dictData`, id, options)
}
